package com.zufangbao.earth.handler.impl;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.zufangbao.earth.handler.CurrentOrderHandler;
import com.zufangbao.gluon.api.electron.CashierInfo;
import com.zufangbao.sun.entity.customer.Customer;
import com.zufangbao.sun.entity.house.House;
import com.zufangbao.sun.entity.order.Order;

@Component("currentOrderHanlder")
public class CurrentOrderHandlerImpl implements CurrentOrderHandler {

	public static Log log = LogFactory.getLog(CurrentOrderHandlerImpl.class);
	
	@Override
	public CashierInfo createCashierInfo(Customer customer,
			Order order, House house) {
		CashierInfo cashierInfo = new CashierInfo();
		
		cashierInfo.setName(customer.getName());
		cashierInfo.setMobile(customer.getMobile());
		
		cashierInfo.setStartDate(order.getStartDate());
		cashierInfo.setEndDate(order.getEndDate());
		
		cashierInfo.setAddress(house.getAddress());
		
		return cashierInfo;
	}

}
